﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LightWeb.Infrastructure.Repositories;

namespace LightWeb.MvcWeb.Areas.SmartPfa.Controllers
{
    public class CrieditCardController : Controller
    {
        //
        // GET: /SmartPfa/CrieditCard/

        public ActionResult Index()
        {
            using (OurTransactionScope ts = new OurTransactionScope())
            {
                var context = DataContext.Current;
                var list = context.Read<DomainModel.BankComm>(null, null);
                ts.Complete();
                return View(list);
            }
        }

        //
        // GET: /SmartPfa/CrieditCard/Details/5

        public ActionResult Details(int id)
        {
            return View();
        }

        //
        // GET: /SmartPfa/CrieditCard/Create

        public ActionResult Create()
        {
            return View();
        }

        //
        // POST: /SmartPfa/CrieditCard/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /SmartPfa/CrieditCard/Edit/5

        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /SmartPfa/CrieditCard/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /SmartPfa/CrieditCard/Delete/5

        public ActionResult Delete(int id)
        {
            return View();
        }

        //
        // POST: /SmartPfa/CrieditCard/Delete/5

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
    }
}
